'use strict';

/**
 * @ngdoc filter
 * @name jgappApp.filter:username
 * @function
 * @description
 * # username
 * Filter in the jgappApp.
 */
angular.module('jgappApp')
    .filter('username', function () {
        return function (input, len) {
            len = len || 3;
            if (input) {
                input = input.slice ? input.slice(-len) : input
            }
            return input;
        };
    }).filter('commentFiler', function ($rootScope) {
        return function (input) {
            if (input) {
                input = input.filter(function (item) {
                    return item.userId != $rootScope.curUID
                })
            }
            return input;
        };
    });
